package com.neuedu.web.controller;

import com.neuedu.web.common.BaseMethodController;
import com.neuedu.web.common.PageInfo;
import com.neuedu.web.service.ConstantsItemService;
import com.neuedu.web.vo.ConstantsItemVO;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * @author 金山
 * 项目：his
 * site: https://blog.fulfill.com.cn
 * 描述  ConstantsType接口
 * @data 2024-11-21 14:21:592
 */
@WebServlet(urlPatterns = "/constants_item/*")
public class ConstantsItemController extends BaseMethodController {

    private ConstantsItemService   constantsItemService = new ConstantsItemService();





    private List<ConstantsItemVO> getAll(HttpServletRequest request , HttpServletResponse response) throws IOException, NoSuchFieldException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {

        return constantsItemService.list(request,response);
    }



    /**
     * 分页查询
     * @param request
     * @param response
     * @return
     * @throws IOException
     * @throws NoSuchFieldException
     * @throws InvocationTargetException
     * @throws NoSuchMethodException
     * @throws InstantiationException
     * @throws IllegalAccessException
     */
    private PageInfo<ConstantsItemVO> page(HttpServletRequest request , HttpServletResponse response) throws IOException, NoSuchFieldException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {

        return constantsItemService.page(request,response);
    }


    /**
     * 添加或更新
     * @param request
     * @param response
     * @return
     * @throws IOException
     */
    public boolean saveOrUpdate(HttpServletRequest request ,HttpServletResponse response) throws IOException {
        return constantsItemService.saveOrUpdate(request,response);
    }


    /**
     * 删除
     * @param request
     * @param response
     * @return
     * @throws IOException
     */
    public boolean delete(HttpServletRequest request ,HttpServletResponse response) throws IOException {
        return constantsItemService.delete(request,response);
    }

    public ConstantsItemVO getById(HttpServletRequest request ,HttpServletResponse response) throws IOException, NoSuchFieldException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
        return constantsItemService.getById(request,response);
    }


}
